package com.tubruk.trackme;

import android.location.Location;

import com.google.android.maps.GeoPoint;

public class MyGeoPoint extends GeoPoint {
	private long timeStart;
	private Double latitude;
	private Double longitude;
	private Location loc;

	public MyGeoPoint(Location location) {
		super((new Double(location.getLatitude() * 1E6)).intValue(), (new Double(location.getLongitude() * 1E6)).intValue());
		this.setLatitude(location.getLatitude() * 1E6);
		this.setLongitude(location.getLongitude() * 1E6);
		this.loc = location;
		this.timeStart = System.currentTimeMillis();
	}
	
	public Location getLocation() {
		return loc;
	}
	
	public long getTimeStart() {
		return timeStart;
	}
	
	public float getOrientation() {
		return loc.getBearing();
	}
	
	public double getAltitude() {
		return loc.getAltitude();
	}
	
	public float getSpeed() {
		return loc.getSpeed();
	}
	
	public float getDistance(Location dest) {
		return loc.distanceTo(dest);
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public Double getLongitude() {
		return longitude;
	}
}
